package com.jc.cloud.sign.controller.tencent;


import com.jc.cloud.sign.bean.dto.FlowQuery;
import com.jc.cloud.sign.common.R;
import com.jc.cloud.sign.service.ContractlistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;

/**
 * <p>
 * 合同管理 前端控制器
 * </p>
 *
 * @author cxc
 * @since 2023-11-16
 */
@Api(tags = "合同管理")
@RestController
@RequestMapping("/contractlist")
public class ContractlistController {

    @Autowired
    private ContractlistService contractlistService;


        /**
         * @Author HongQiYi
         * @Description 合同分页查询
         **/
    @ApiOperation("合同分页查询")
    @PostMapping("flow/{current}/{limit}")
    public R pageCourseCondition(@PathVariable Long current,
                                 @PathVariable Long limit,
                                 @RequestBody(required = false) FlowQuery flowQuery) {
        HashMap<Object, Object> data = contractlistService.selectBypage(current,limit,flowQuery);
        return R.ok().put("data", data);
    }


    //    TODO
    @ApiOperation("合同分页查询sql")
    @PostMapping("/list/search/{page}/{size}")
    public R search(
            @PathVariable("page") long page,
            @PathVariable("size") long size,
            @RequestBody(required = false) FlowQuery flowQuery
    ) {
        return contractlistService.search(page, size, flowQuery);
    }

}

